import Vue from 'vue'
import Router from 'vue-router'




//二级路由
import Member from '@/pages/member/member';//用户列表
import Machine from '@/pages/machine/machine';//设备列表


import Message from '@/pages/content/messageWrapper/message';//短信管理

import QuestionWrapper from '@/pages/question/questionWrapper';
import QuestionList from '@/pages/question/questionWrapper/questionList';//题库列表
import AddQuestion from '@/pages/question/questionWrapper/addQuestion';//题库编辑页

import SubjectWrapper from '@/pages/question/subjectWrapper';
import SubjectList from  '@/pages/question/subjectWrapper/subjectList';//题目列表
import OptionList from '@/pages/question/subjectWrapper/optionList';//选项列表

import Archives from '@/pages/archives/archives';//档案列表
import Party from '@/pages/party/party';//党员列表
import Setting from '@/pages/system/setting';//轮播图管理

//  内容编辑页
import VideoWrapper from '@/pages/content/videoWrapper';
import Video from '@/pages/content/videoWrapper/video';//视频管理
import VideoEditor from '@/pages/content/videoWrapper/videoEditor';//视频添加页

import PaperWrapper from '@/pages/content/paperWrapper';

import Paper from '@/pages/content/paperWrapper/paper';//文章管理
import PaperEditor from '@/pages/content/paperWrapper/paperEditor';//内容添加页


Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/login',
      component: ()=>import ('./../pages/login/login'),
      name: 'Login',
      meta:{
        name:'登录'
      }
    },
    {
      path: '/',
      component: ()=>import ('./../pages/login/login'),
      redirect:'/login',
      meta:{
        name:'登录'
      }
    },
    {
      path:'/home',
      component: ()=>import ('./../pages/home/home'),
      name: 'Home',
      redirect:'/member',
      meta:{
        name:'首页'
      },
      children:[
        {
          path:'/member',
          component: Member,
          name: 'Member',
          meta:{
            father_title:'用户管理',
            title:'用户列表'
          }
        },
        {
          path:'/machine',
          component: Machine,
          name: 'Machine',
          meta:{
            father_title:'设备管理',
            title:'设备列表'
          }
        },
        {
          path:'/paperWrapper',
          component: PaperWrapper,
          name: 'PaperWrapper',
          redirect:'/paper',
          meta:{
            father_title:'内容管理',
            title:'文章管理',
            type:'wrapper',
          },
          children:[
            {
              path:'/paper',
              component: Paper,
              name: 'Paper',
              meta:{
                type:'firstChild'
              }
            },
            {
              path:'/paperEditor',
              component: PaperEditor,
              name: 'PaperEditor',
              meta:{
                father_title:'文章管理',
                title:'文章编辑'
              }
            }
          ]
        },
        {
          path:'/videoWrapper',
          component: VideoWrapper,
          name: 'VideoWrapper',
          redirect:'/video',
          meta:{
            father_title:'内容管理',
            title:'视频管理',
            type:'wrapper'
          },
          children:[
            {
              path:'/video',
              component: Video,
              name: 'Video',
              meta:{
                type:'firstChild'
              }
            },
            {
              path:'/videoEditor',
              component: VideoEditor,
              name: 'VideoEditor',
              meta:{
                father_title:'视频管理',
                title:'视频编辑'
              }
            }
          ]
        },
        {
          path:'/questionWrapper',
          component: QuestionWrapper,
          name: 'QuestionWrapper',
          redirect:'/questionList',
          meta:{
            father_title:'问答管理',
            title:'题库列表',
            type:'wrapper'
          },
          children:[
            {
              path:'/questionList',
              component: QuestionList,
              name: 'QuestionList',
              meta:{
                type:'firstChild'
              },
            },
            {
              path: '/addQuestion',
              component: AddQuestion,
              name: 'AddQuestion',
              meta:{
                father_title: '题库列表',
                title: '题库编辑'
              }
            }
          ]
        },
        {
          path:'/subjectWrapper',
          component: SubjectWrapper,
          name: 'SubjectWrapper',
          redirect:'/subjectList',
          meta: {
            father_title:'问答管理',
            title:'题目列表',
            type:'wrapper'
          },
          children:[
            {
              path:'/subjectList',
              component: SubjectList,
              name: 'SubjectList',
              meta:{
                type:'firstChild'
              },
            },
            {
              path: '/optionList',
              component: OptionList,
              name: 'OptionList',
              meta:{
                father_title: '题目列表',
                title: '选项列表'
              }
            }
          ]
        },
        {
          path:'/message',
          component: Message,
          name: 'Message',
          meta:{
            father_title:'内容管理',
            title:'短信管理'
          }
        },
        {
          path:'/archives',
          component: Archives,
          name: 'archives',
          meta:{
            father_title:'档案管理',
            title:'档案列表'
          }
        },
        {
          path:'/party',
          component: Party,
          name: 'party',
          meta:{
            father_title:'党员管理',
            title:'党员列表'
          }
        },
        
        {
          path:'/setting',
          component: Setting,
          name: 'Setting',
          meta:{
            father_title:'系统管理',
            title:'设置'
          }
        }
      ],
    }
  ]
})
